// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   sc_control.java

package sql;

import bo.Service_conf;
import control.database.DataBase;
import java.io.PrintStream;
import java.sql.ResultSet;
import java.sql.SQLException;

public class sc_control
{

    public sc_control()
    {
    }

    public Service_conf select(short servid)
        throws SQLException
    {
        ResultSet rs = null;
        Service_conf sc = new Service_conf();
        DataBase db = new DataBase();
        String sql = "select * from service_conf where servid=" + servid;
        System.out.println("servid" + sql);
        rs = db.executeQuery(sql);
        if(rs.next())
        {
            sc.setServid(rs.getShort("servid"));
            sc.setName(rs.getString("name"));
            sc.setMaxmailn(rs.getInt("maxmailn"));
            sc.setMaxfanxn(rs.getInt("maxfaxn"));
            sc.setMaxmsgn(rs.getInt("maxmsgn"));
            sc.setMaxsize(rs.getInt("maxsize"));
            sc.setMaxudisksize(rs.getInt("maxudisksize"));
            sc.setMaxvoicen(rs.getInt("maxvoicen"));
            sc.setMaxfaxtime(rs.getInt("maxfaxtime"));
        }
        rs.close();
        db.closeStmt();
        db.closeConn();
        return sc;
    }

    public static void main(String args[])
    {
        sc_control sc_scon = new sc_control();
        Service_conf ser_conf = new Service_conf();
        try
        {
            ser_conf = sc_scon.select((short)3);
        }
        catch(SQLException e)
        {
            e.printStackTrace();
        }
        
        System.out.println("iiiiii=" +Short.parseShort((ser_conf.getMaxsize()+"")) + "max=" + ser_conf.getMaxudisksize());
    }
}
